package com.dmwork.service.customer.config;

import com.dmwork.service.customer.properties.SmsProperties;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.sms.v20190711.SmsClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SmsConfig {
    @Autowired
    private SmsProperties smsProperties;

    @Bean
    public SmsClient smsClient() {
        Credential credential = new Credential(smsProperties.getSecretId(), smsProperties.getSecretKey());
        return new SmsClient(credential, smsProperties.getRegion());
    }

}
